#include <iostream>
#include <sys/types.h>
#include <unistd.h>

int main()
{
    int ret = fork();
    if (ret < 0){
        perror("fork");
        return 1;
    }
    else if (ret == 0){
        printf("child p, pid: %d, ret: %d\n", getpid(), ret);
    }
    else if (ret > 0){
        printf("father p, pid: %d, ret: %d\n", getpid(), ret);
    }

    return 0;
}